// https://nuxt.com/docs/api/configuration/nuxt-config
import { defineNuxtConfig } from "nuxt/config"
import AutoImport from "unplugin-auto-import/vite"
import Components from "unplugin-vue-components/vite"
import { NaiveUiResolver } from "unplugin-vue-components/resolvers"

export default defineNuxtConfig({
  devtools: {
    enabled: true,
  },
  app: {
    head: {
      title: 'template',
      link: [
        { rel: 'icon', type: 'image/x-icon', href: 'favicon.png' }
      ],
      script: [
        // { src: '/baidu.js' }
      ],
      meta: [
        { charset: 'utf-8' },
        { name: 'format-detection', content: 'telephone=no' },
        { name: 'viewport', content: 'width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0' },
        { name: 'naive-ui-style' },
        { name: 'vueuc-style' },
      ],
    }
  },
  css: ["@/assets/style/tailwind.css", "@/assets/style/vfont.css"],
  postcss: {
    plugins: {
      autoprefixer: {},
      tailwindcss: {},
    },
  },
  modules: ['@pinia/nuxt', '@vueuse/nuxt', "nuxtjs-naive-ui"],
  vite: {
    plugins: [
      AutoImport({
        imports: [
          {
            "naive-ui": ["useDialog", "useMessage", "useNotification", "useLoadingBar"],
          },
        ],
      }),
      Components({
        resolvers: [NaiveUiResolver()],
      }),
    ],
  },
  imports: {
    // Auto-import pinia stores defined in `~/stores`
    dirs: ['stores']
  },
})
